﻿using HK.Core.Common;
using HK.Core.Extend;
using UnityEditor;
using UnityEngine;

namespace HK.Editor.Common
{
    /// <summary>
    /// 编辑器常量
    /// </summary>
    public static class EditorConst
    {
        
#region Path & Dir
        
        /// <summary>
        /// Editor用根目录
        /// </summary>
        public const string HK_EDITOR_RESOURCE_DIR = Const.HK_EDITOR_ROOT_DIR + "/Resources";

        /// <summary>
        /// Editor用Icon根目录
        /// </summary>
        private const string HK_EDITOR_ICONS_DIR = HK_EDITOR_RESOURCE_DIR + "/Icons";

#endregion

#region Size & Rect
        
        /// <summary>
        /// 余白 - 纵向
        /// </summary>
        public static readonly float Spacing = 2.0f;

        /// <summary>
        /// 余白 - 横向
        /// </summary>
        public static readonly float HorizontalSpacing = Spacing;
		                
        /// <summary>
        /// 余白 - 纵向
        /// </summary>
        public static readonly float VerticalSpacing = Spacing;

        /// <summary>
        /// Label先头缩进
        /// </summary>
        public static readonly float LabelIntent = Spacing * 2;
        
        /// <summary>
        /// 展开按钮缩进
        /// </summary>
        public static readonly float ExpandableIntent = 18.0f;

        /// <summary>
        /// Drag Mark宽度
        /// </summary>
        public static readonly float DragMarkWidth = 18.0f;
        
        /// <summary>
        /// 默认行高
        /// </summary>
        public static readonly float DefaultLineHeight = EditorGUIUtility.singleLineHeight;
        
        /// <summary>
        /// 宽度 - 按钮 - 极短
        /// </summary>
        public static readonly float BtnWidthMinShort = 20.0f;
        
        /// <summary>
        /// 宽度 - 按钮 - 较短
        /// </summary>
        public static readonly float BtnWidthMidShort = 50.0f;
        
        /// <summary>
        /// 按钮宽度 - 短
        /// </summary>
        public static readonly float BtnWidthShort = 60.0f;
        
        /// <summary>
        /// 按钮宽度 - 中
        /// </summary>
        public static readonly float BtnWidthMid = 80.0f;
        
        /// <summary>
        /// 按钮宽度 - 长
        /// </summary>
        public static readonly float BtnWidthLong = 100.0f;
                
        /// <summary>
        /// 按钮宽度 - 巨长
        /// </summary>
        public static readonly float BtnWidthMegaLength = 140.0f;
        
        /// <summary>
        /// 按钮宽度 - 仅是Icon的按钮
        /// </summary>
        public static readonly float BtnWidthIconOnly = 16.0f;
        
        /// <summary>
        /// 按钮宽度 - Footer按钮
        /// </summary>
        public static readonly float FooterBtnWidth = 25.0f;
        
        /// <summary>
        /// 按钮高度 - 仅是Icon的按钮
        /// </summary>
        public static readonly float BtnHeightIconOnly = 16.0f;

        /// <summary>
        /// Toggle宽度
        /// </summary>
        public static readonly float ToggleWidth = 20.0f;
        
        /// <summary>
        /// 展开/缩进箭头宽度
        /// </summary>
        public static readonly float ExpandArrowWidth = 16.0f;
        
        /// <summary>
        /// 行头缩进宽度
        /// </summary>
        public static readonly float RowHeadIndentWidth = 20.0f;
        
        /// <summary>
        /// TreeView - 行高
        /// </summary>
        public static readonly float TreeViewRowHeight = 22.0f;

#endregion

#region Icons
        
        /// <summary>
        /// Icon - Build
        /// </summary>
        public const string IconBuild = HK_EDITOR_ICONS_DIR + "/icon_build_16x16.png";
        
        /// <summary>
        /// Icon - Fix
        /// </summary>
        public const string IconFix = HK_EDITOR_ICONS_DIR + "/icon_build_16x16.png";
        
        /// <summary>
        /// Icon - 清空
        /// </summary>
        public const string IconClear = HK_EDITOR_ICONS_DIR + "/icon_clear_16x16.png";
        
        /// <summary>
        /// Icon - 强制清空
        /// </summary>
        public const string IconForceClear = HK_EDITOR_ICONS_DIR + "/icon_force_clear_16x16.png";
        
        /// <summary>
        /// Icon - Apply
        /// </summary>
        public const string IconApply = HK_EDITOR_ICONS_DIR + "/icon_apply_16x16.png";
        
        /// <summary>
        /// Icon - 导入
        /// </summary>
        public const string IconImport = HK_EDITOR_ICONS_DIR + "/icon_import_16x16.png";
        
        /// <summary>
        /// Icon - 导出
        /// </summary>
        public const string IconExport = HK_EDITOR_ICONS_DIR + "/icon_export_16x16.png";

        /// <summary>
        /// Icon - 追加
        /// </summary>
        public const string IconAdd = HK_EDITOR_ICONS_DIR + "/icon_add.png";
        
        /// <summary>
        /// Icon - 追加1
        /// </summary>
        public const string IconAdd1 = HK_EDITOR_ICONS_DIR + "/icon_add1_16x16.png";

        /// <summary>
        /// Icon - 保存
        /// </summary>
        public const string IconSave = HK_EDITOR_ICONS_DIR + "/icon_save_16x16.png";
        
        /// <summary>
        /// Icon - 编辑
        /// </summary>
        public const string IconEdit = HK_EDITOR_ICONS_DIR + "/icon_edit_16x16.png";
        
        /// <summary>
        /// Icon - 删除
        /// </summary>
        public const string IconDel = HK_EDITOR_ICONS_DIR + "/icon_delete_16x16.png";
        
        /// <summary>
        /// Icon - 运行/执行
        /// </summary>
        public const string IconExecute = HK_EDITOR_ICONS_DIR + "/icon_execute_16x16.png";
        
        /// <summary>
        /// Icon - 勾选
        /// </summary>
        public const string IconCheckIn = HK_EDITOR_ICONS_DIR + "/icon_check_in_16x16.png";
        
        /// <summary>
        /// Icon - 不勾选
        /// </summary>
        public const string IconCheckOut = HK_EDITOR_ICONS_DIR + "/icon_check_out_16x16.png";
        
        /// <summary>
        /// Icon - 恢复
        /// </summary>
        public const string IconRestore = HK_EDITOR_ICONS_DIR + "/icon_restore_16x16.png";
        
        /// <summary>
        /// Icon - 回滚/撤销
        /// </summary>
        public const string IconRevert = HK_EDITOR_ICONS_DIR + "/icon_revert_16x16.png";
        
        /// <summary>
        /// Icon - Lock
        /// </summary>
        public const string IconLock = HK_EDITOR_ICONS_DIR + "/icon_lock_16x16.png";
        
        /// <summary>
        /// Icon - 分析
        /// </summary>
        public const string IconAnalysis = HK_EDITOR_ICONS_DIR + "/icon_analysis_16x16.png";
        
        /// <summary>
        /// Icon - 刷新
        /// </summary>
        public const string IconRefresh = HK_EDITOR_ICONS_DIR + "/icon_refresh_16x16.png";
        
        /// <summary>
        /// Icon - 优化
        /// </summary>
        public const string IconOptimize = HK_EDITOR_ICONS_DIR + "/icon_optimize_16x16.png";
        
        /// <summary>
        /// Icon - UnLock
        /// </summary>
        public const string IconUnLock = HK_EDITOR_ICONS_DIR + "/icon_unlock_16x16.png";
        
        /// <summary>
        /// Icon - 预览
        /// </summary>
        public const string IconReview = HK_EDITOR_ICONS_DIR + "/icon_review_16x16.png";      
        
        /// <summary>
        /// Icon - 可拖拽
        /// </summary>
        public const string IconDraggable = HK_EDITOR_ICONS_DIR + "/icon_drag_16x16.png";        
        
        /// <summary>
        /// Icon - 浏览
        /// </summary>
        public const string IconBrowse = HK_EDITOR_ICONS_DIR + "/icon_browse_16x16.png";        
        
        /// <summary>
        /// Icon - 选项
        /// </summary>
        public const string IconOptions = HK_EDITOR_ICONS_DIR + "/icon_options_16x16.png";
        
        /// <summary>
        /// Icon - Sns
        /// </summary>
        public const string IconSns = HK_EDITOR_ICONS_DIR + "/icon_sns_16x16.png";
        
        /// <summary>
        /// Icon - 诊断
        /// </summary>
        public const string IconDiagnose = HK_EDITOR_ICONS_DIR + "/icon_diagnose_16x16.png";
        
        /// <summary>
        /// Icon - 历史记录
        /// </summary>
        public const string IconHistory = HK_EDITOR_ICONS_DIR + "/icon_history_16x16.png";
        
        /// <summary>
        /// Icon - 白名单
        /// </summary>
        public const string IconWhiteList = HK_EDITOR_ICONS_DIR + "/icon_whitelist_16x16.png";
        
        /// <summary>
        /// Icon - 目标
        /// </summary>
        public const string IconTarget = HK_EDITOR_ICONS_DIR + "/icon_target_16x16.png";
        
        /// <summary>
        /// Icon - iOS
        /// </summary>
        public const string IconIOS = HK_EDITOR_ICONS_DIR + "/icon_apple_16x16.png";
        
        /// <summary>
        /// Icon - Android
        /// </summary>
        public const string IconAndroid = HK_EDITOR_ICONS_DIR + "/icon_android_16x16.png";
        
        /// <summary>
        /// Icon - Pc
        /// </summary>
        public const string IconPc = HK_EDITOR_ICONS_DIR + "/icon_pc_16x16.png";
        
        /// <summary>
        /// Icon - Pc64
        /// </summary>
        public const string IconPc64 = HK_EDITOR_ICONS_DIR + "/icon_pc64_16x16.png";
        
        /// <summary>
        /// Icon - Ps4
        /// </summary>
        public const string IconPs4 = HK_EDITOR_ICONS_DIR + "/icon_ps4_16x16.png";
        
        /// <summary>
        /// Icon - Ps5
        /// </summary>
        public const string IconPs5 = HK_EDITOR_ICONS_DIR + "/icon_ps5_16x16.png";
        
        /// <summary>
        /// Icon - xBox
        /// </summary>
        public const string IconXbox = HK_EDITOR_ICONS_DIR + "/icon_xbox_16x16.png";
        
        /// <summary>
        /// Icon - Switch
        /// </summary>
        public const string IconSwitch = HK_EDITOR_ICONS_DIR + "/icon_switch_16x16.png";
        
        /// <summary>
        /// Icon - New
        /// </summary>
        public const string IconNew = HK_EDITOR_ICONS_DIR + "/icon_new_16x16.png";
        
        /// <summary>
        /// Icon - Effect
        /// </summary>
        public const string IconEffect = HK_EDITOR_ICONS_DIR + "/icon_effect_16x16.png";
        
        /// <summary>
        /// Icon - Disable
        /// </summary>
        public const string IconDisable = HK_EDITOR_ICONS_DIR + "/icon_disable_16x16.png";
        
        /// <summary>
        /// Icon - Enable
        /// </summary>
        public const string IconEnable = HK_EDITOR_ICONS_DIR + "/icon_enable_16x16.png";
        
        /// <summary>
        /// Icon - Notice
        /// </summary>
        public const string IconNotice = HK_EDITOR_ICONS_DIR + "/icon_notice_16x16.png";
        
        /// <summary>
        /// Icon - 分辨率
        /// </summary>
        public const string IconResolution = HK_EDITOR_ICONS_DIR + "/icon_resolution_16x16.png";
        
        /// <summary>
        /// Icon - 文件夹
        /// </summary>
        public const string IconFolder = HK_EDITOR_ICONS_DIR + "/icon_folder_16x16.png";
        
        /// <summary>
        /// Icon - 文件大小
        /// </summary>
        public const string IconFilesize = HK_EDITOR_ICONS_DIR + "/icon_filesize_16x16.png";
        
        /// <summary>
        /// Icon - 骨骼
        /// </summary>
        public const string IconSkeleton = HK_EDITOR_ICONS_DIR + "/icon_skeleton_16x16.png";
        
        /// <summary>
        /// Icon - 噪音图
        /// </summary>
        public const string IconNoise = HK_EDITOR_ICONS_DIR + "/icon_noise_16x16.png";
        
        /// <summary>
        /// Icon - Missing
        /// </summary>
        public const string IconMissing = HK_EDITOR_ICONS_DIR + "/icon_missing_16x16.png";
        
        /// <summary>
        /// Icon - 设定
        /// </summary>
        public const string IconSettings = HK_EDITOR_ICONS_DIR + "/icon_settings_16x16.png";
        
        /// <summary>
        /// Icon - 阈值
        /// </summary>
        public const string IconThreshold = HK_EDITOR_ICONS_DIR + "/icon_threshold_16x16.png";
        
        /// <summary>
        /// Icon - All
        /// </summary>
        public const string IconAll = HK_EDITOR_ICONS_DIR + "/icon_all_16x16.png";
        
        /// <summary>
        /// Icon - 混合
        /// </summary>
        public const string IconMix = HK_EDITOR_ICONS_DIR + "/icon_mix_16x16.png";
        
        /// <summary>
        /// Icon - 推荐
        /// </summary>
        public const string IconRecommend = HK_EDITOR_ICONS_DIR + "/icon_recommend_16x16.png";
        
        /// <summary>
        /// Icon - Info
        /// </summary>
        public const string IconInfo = HK_EDITOR_ICONS_DIR + "/icon_info_16x16.png";
        
        /// <summary>
        /// Icon - Curves
        /// </summary>
        public const string IconCurves = HK_EDITOR_ICONS_DIR + "/icon_curves_16x16.png";
        
        /// <summary>
        /// Icon - 纹理
        /// </summary>
        public const string IconTexture = HK_EDITOR_ICONS_DIR + "/icon_texture_16x16.png";
        
        /// <summary>
        /// Icon - 纹理格式
        /// </summary>
        public const string IconTexFormat = HK_EDITOR_ICONS_DIR + "/icon_texture_16x16.png";
        
        /// <summary>
        /// Icon - 一般
        /// </summary>
        public const string IconGeneral = HK_EDITOR_ICONS_DIR + "/icon_general_16x16.png";
        
        /// <summary>
        /// Icon - Console
        /// </summary>
        public const string IconConsole = HK_EDITOR_ICONS_DIR + "/icon_console_16x16.png";

#endregion

#region Borders
        
        /// <summary>
        /// Border - 提示区域
        /// </summary>
        public const string BorderNotice = HK_EDITOR_ICONS_DIR + "/border_notice_16x16.png"; 
        
        /// <summary>
        /// Border - 激活状态
        /// </summary>
        public const string BorderActivated = HK_EDITOR_ICONS_DIR + "/border_activated_16x16.png"; 

#endregion

#region Menu

#region Defines

        /// <summary>
        /// 菜单优先级 - Tools/HK/宏设定
        /// </summary>
        public const int MENU_PRIORITY_TOOL_DEFINES = 200;
                                
        /// <summary>
        /// 菜单文本 - Tools/HK/宏设定
        /// </summary>
        public const string MENU_TXT_TOOL_DEFINES = "Tools/" + Const.HK_LIB_NAME + "/宏设定";

#endregion

#region DownloadVerify

        /// <summary>
        /// 菜单优先级 - Tools/HK/验证/下载验证
        /// </summary>
        public const int MENU_PRIORITY_DOWNLOAD_VERIFY = 201;
                                        
        /// <summary>
        /// 菜单文本 - Tools/HK/验证/下载验证
        /// </summary>
        public const string MENU_TXT_TOOL_DOWNLOAD_VERIFY = "Tools/" + Const.HK_LIB_NAME + "/验证/下载验证";

#endregion

#region Defines

        /// <summary>
        /// 菜单优先级 - Tools/HK/监视/加载
        /// </summary>
        public const int MENU_PRIORITY_TOOL_LOAD_WATCH_WIN = 202;
                                        
        /// <summary>
        /// 菜单文本 - Tools/HK/监视/加载
        /// </summary>
        public const string MENU_TXT_TOOL__LOAD_WATCH_WIN = "Tools/" + Const.HK_LIB_NAME + "/监视/加载";

#endregion

#region Sample

#region SceneRenderSettings

        /// <summary>
        /// 菜单优先级 - Tools/HK/采样/场景渲染设定(当前)
        /// </summary>
        public const int MENU_PRIORITY_SAMPLE_RENDER_SETTINGS = 210;
                                                
        /// <summary>
        /// 菜单文本 - Tools/HK/采样/场景/渲染设定(当前)
        /// </summary>
        public const string MENU_TXT_TOOL_SAMPLE_RENDER_SETTINGS = "Tools/" + Const.HK_LIB_NAME + "/采样/场景/渲染设定(当前)";
        
        /// <summary>
        /// 菜单优先级 - Tools/HK/采样/场景渲染设定(All)
        /// </summary>
        public const int MENU_PRIORITY_SAMPLE_ALL_RENDER_SETTINGS = 211;
                                                
        /// <summary>
        /// 菜单文本 - Tools/HK/采样/场景/渲染设定(All)
        /// </summary>
        public const string MENU_TXT_TOOL_SAMPLE_ALL_RENDER_SETTINGS = "Tools/" + Const.HK_LIB_NAME + "/采样/场景/渲染设定(All)";

#endregion

#endregion

#region iOS

        /// <summary>
        /// 菜单优先级 - Tools/HK/Build/ExportXCodePro
        /// </summary>
        public const int MENU_PRIORITY_EXPORT_XCOE = 300;
                                        
        /// <summary>
        /// 菜单文本 - Tools/HK/Build/ExportXCodePro
        /// </summary>
        public const string MENU_TXT_TOOL_EXPORT_XCOE = "Tools/" + Const.HK_LIB_NAME + "/Build/ExportXCodePro";

#endregion

#region Helper

        /// <summary>
        /// 菜单优先级 - Tools/HK/Helper/GUI/Unity内置样式
        /// </summary>
        public const int MENU_PRIORITY_UNITY_GUI_STYLE_VIEW = 901;
                        
        /// <summary>
        /// 菜单文本- Tools/HK/Helper/GUI/Unity内置样式
        /// </summary>
        public const string MENU_TXT_UNITY_GUI_STYLE_VIEW = "Tools/" + Const.HK_LIB_NAME + "/Helper/GUI/Unity内置样式";
        
        /// <summary>
        /// 菜单优先级 - Tools/HK/Helper/GUI/颜色列表
        /// </summary>
        public const int MENU_PRIORITY_GUI_COLORS_VIEW = 902;
                
        /// <summary>
        /// 菜单文本- Tools/HK/Helper/GUI/颜色列表
        /// </summary>
        public const string MENU_TXT_GUI_COLORS_VIEW = "Tools/" + Const.HK_LIB_NAME + "/Helper/GUI/颜色列表";
        
        /// <summary>
        /// 菜单优先级 - Tools/HK/Helper/GUI/Unity内置Icon
        /// </summary>
        public const int MENU_PRIORITY_UNITY_DEFAULT_GUI_ICONS_VIEW = 903;
                
        /// <summary>
        /// 菜单文本- Tools/HK/Helper/GUI/Unity内置Icon
        /// </summary>
        public const string MENU_TXT_UNITY_DEFAULT_GUI_ICONS_VIEW = "Tools/" + Const.HK_LIB_NAME + "/Helper/GUI/Unity内置Icon";

#endregion

#endregion

#region Colors
        
        /// <summary>
        /// 颜色 - 可拖拽区域
        /// </summary>
        public static readonly UnityEngine.Color ColorDraggable = new Color(212.0f / 255.0f, 35.0f / 255.0f, 122.0f/ 255.0f, 1.0f);
        
        /// <summary>
        /// 颜色 - 可点击区域
        /// </summary>
        public static readonly UnityEngine.Color ColorClickable = ColorEx.LimeGreen;

#endregion

#region Conf

    /// <summary>
    /// 菜单优先级
    /// </summary>
    public enum EditorConstMenuPriority
    {
        BuildConf = 2001
    }
    
    /// <summary>
    /// 文件数据目录
    /// <para>* 可序列化资产文件</para>
    /// </summary>
    public const string SASSET_FILE_DATA_DIR = Const.HK_EDITOR_SASSET_DIR + "/Data";
    
    /// <summary>
    /// 文件数据目录
    /// <para>* 窗体数据目录</para>
    /// </summary>
    public const string WIN_FILE_DATA_DIR = Const.HK_WIN_DATA_DIR + "/Data";
    
#region BuildConf

    /// <summary>
    /// 资产文件名 - BuildConf
    /// <para>* 文件后缀 *.asset</para>
    /// </summary>
    public const string SASSET_FILE_BUILD_CONF = Const.HK_EDITOR_SASSET_DIR + "/BuildConf";
                    
    /// <summary>
    /// 菜单文本 - Assets/Create/HK/Conf/BuildConf
    /// </summary>
    public const string MENU_TXT_BUILD_CONF = Const.HK_LIB_NAME + "/Conf/BuildConf";

#endregion

#endregion

    }
}
